package net.kelissa.divizor.util.randomdata;

import java.util.ArrayList;
import java.util.List;

import net.kelissa.divizor.model.DataModel;
import net.kelissa.divizor.util.MathUtil;

/**
 * 2D random vector creator
 * @author tazzo
 *
 */
public abstract class RandomDataCreator
{


  public List<DataModel> createData(int n)
  {
    List<DataModel> l = new ArrayList<DataModel>();
    for (int i = 0; i < n; i++)
    {
      l.add(createRandomData());
    }
    return l;
  }

  public DataModel createRandomData()
  {
    DataModel dm = new DataModel();
    double x = MathUtil.getDefaultRandom();
    double y = MathUtil.getDefaultRandom();
    double[] v = {x,y};
    String label = getLabel(x, y);
    dm.setPosition(v);
    dm.setClazzLabel(label);
    return dm;
  }

  abstract public  String getLabel(double x, double y);

}
